import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import VueI18n from 'vue-i18n'
import Element from 'element-ui'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import * as echarts from 'echarts'
//挂载到全局
Vue.prototype.$echarts = echarts
import './plugins/element.js'
import './assets/css/reset.css'

//用于控制 Vue 在启动时是否显示生产模式下的提示信息。
Vue.config.productionTip = false

Vue.use(VueI18n)
//准备语言
const messages = {
  en: {
    goods: {
      home: 'home',
      goods: 'Goods Manage',
      params: 'Specification'
    },
    ...enLocale
  },
  zh: {
    goods: {
      home: '首页',
      goods: '商品管理',
      params: '规格参数'
    },
    ...zhLocale
  }
}
const i18n = new VueI18n({
  locale: 'zh',
  messages
})

Vue.use(Element, {
  i18n: (key, value) => i18n.t(key, value)
})



new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
